package com.junyi;

import javax.swing.text.StyleConstants;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;

/**
 * @time: 2022/7/22 17:49
 * @version: 1.0
 * @author: junyi Xu
 * @description:
 */
public class A {

    public static void main(String[] args) throws FileNotFoundException {
        String dbPath = "G:\\Tool\\ip2region.xdb";
        try (RandomAccessFile file = new RandomAccessFile(dbPath, "r")) {
            try {
                byte[] buffer = new byte[16];
                int effect = file.read(buffer);
                System.out.println(effect);
                String s = new String(buffer, "utf-8");
                System.out.println(s);
            } catch (IOException e) {
                e.printStackTrace();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
